package com.kuang.service;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

/**
 * @program: dubbo+zookeeper
 * @description:
 * @author: 陈恩涛
 * @create: 2020-11-05 09:35
 **/

@Service
public class UserService {

    //想拿到provider-server提供的票，要去注册中心拿到服务

    @Reference      //POM坐标，或定义路径相同的接口类
    TicketService ticketService;

    public void buyTicket(){
        String ticket = ticketService.getTicket();
        System.out.println("在注册中心zookeeper中拿到==>"+ticket);
    }
}
